<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,user-scalable=no">
    <link rel="stylesheet" href="../src/josh-ui.css">
    <title>JoshUi-弹出式菜单</title>
</head>
<body>
    <div class="ju-content">
        <h1 class="ju-panel-title">ActionSheet弹出式菜单</h1>
        <div class="ju-panel-body">
            <a class="ju-btn" id="js-show">显示弹出菜单</a>
        </div>
    </div>
    <div class="ju-action-sheet">
        <div class="ju-mask"></div>
        <div class="ju-action-sheet-wrap">
            <div class="ju-action-sheet-header">
                <h1 class="ju-action-sheet-title">你需要什么操作？</h1>
            </div>
            <div class="ju-action-sheet-body">
                <a class="ju-action-sheet-menu">收藏</a>
                <a class="ju-action-sheet-menu">关注</a>
                <a class="ju-action-sheet-menu">分享给好友</a>
            </div>
            <div class="ju-action-sheet-footer">
                <a class="ju-action-sheet-menu" id="js-close">取消</a>
            </div>
        </div>
    </div>
</body>
<script>
    window.onload = () => {
        let actionSheetEle = document.querySelector('.ju-action-sheet');
        // 弹出菜单
        document.getElementById('js-show').onclick = (event) => {
            actionSheetEle.classList.add('show');
        }
        // 收回菜单
        document.getElementById('js-close').onclick = (event) => {
            actionSheetEle.classList.remove('show');
        }
    };
</script>
</html>